package com.ck.easy.common.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ck.easy.common.convert.GenderConverter;
import lombok.Data;

import java.util.Date;

/**
 * @author ck
 * @date 2023/8/25 16:46
 */
@TableName("source_table")
@Data
public class SourceEntity {
    /**
     * EasyExcel测试对象
     */
    @ExcelProperty(value = "学号", index = 0)
    @ColumnWidth(20)
    private Integer id;
    @ExcelProperty(value = "年级", index = 1)
    @ColumnWidth(20)
    private String senior;
    @ExcelProperty(value = "学生", index = 2)
    @ColumnWidth(20)
    private String name;
    @ExcelProperty(value = "语文", index = 3)
    @ColumnWidth(20)
    private Integer chinaese;
    @ExcelProperty(value = "英语", index = 4)
    @ColumnWidth(20)
    private Integer english;
    @ExcelProperty(value = "数学", index = 5)
    @ColumnWidth(20)
    private Integer math;
    @ExcelProperty(value = "综合科", index = 6)
    @ColumnWidth(20)
    private Integer comprehensive;
    @ExcelProperty(value = "性别", index = 7,converter = GenderConverter.class)
    @ColumnWidth(10)
    private Integer gender;

    @ExcelProperty(value = "身高(米)", index = 8)
    @ColumnWidth(20)
    @NumberFormat("#.##")
    private Double height;

    @ExcelProperty(value = "创建时间", index = 9)
    @ColumnWidth(20)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private Date createDate;
}
